# Maintainer: Hugo Osvaldo Barrera <hugo@whynothugo.nl>
pkgname=ruff-lsp
pkgver=0.0.53
pkgrel=0
pkgdesc="Language Server Protocol implementation for Ruff"
url="https://github.com/charliermarsh/ruff-lsp"
arch="all"
license="MIT"
depends="
	py3-gls
	py3-lsprotocol
	py3-typing-extensions
	ruff
	"
makedepends="py3-gpep517 py3-installer py3-hatchling"
checkdepends="py3-lsp-jsonrpc py3-pytest"
subpackages="$pkgname-pyc"
source="$pkgname-$pkgver.tar.gz::https://github.com/astral-sh/ruff-lsp/archive/refs/tags/v$pkgver.tar.gz"
options="!check" # no tests ran

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	.testenv/bin/python3 -m installer .dist/*.whl
	.testenv/bin/python3 -m unittest
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/ruff_lsp-$pkgver-py3-none-any.whl
}

sha512sums="
a5a14299486943dec3143e54424b631acee619d3d88449de44c4d8167dd7776e2191a8873585acf40959d22f733a7196e275e58a6b4f0919fe8e2858e2d07414  ruff-lsp-0.0.53.tar.gz
"
